package com.projectzqjz.parttimework.adapter;

import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.projectzqjz.parttimework.R;
import com.projectzqjz.parttimework.entity.DailyEntity;

import java.util.List;

public class Part3JobPubAdapter extends BaseQuickAdapter<DailyEntity, BaseViewHolder> {
    private List<DailyEntity> newsList;

    public Part3JobPubAdapter(List<DailyEntity> newsList) {
        super(R.layout.item_part3_job, newsList);
        this.newsList = newsList;
    }

    @Override
    protected void convert(BaseViewHolder helper, DailyEntity item) {
        View line = helper.getView(R.id.tv_line);
        if (helper.getPosition() == newsList.size() - 1) {
            line.setVisibility(View.GONE);
        }

        ((TextView) helper.getView(R.id.tv_title)).setText(item.getTitle());
        ((TextView) helper.getView(R.id.tv_money)).setText(item.getMoney());
        ((TextView) helper.getView(R.id.tv_unit)).setText(item.getUnit());
        ((TextView) helper.getView(R.id.label)).setText(item.getLabel());
        ((TextView) helper.getView(R.id.tv_gsName)).setText(item.getGsName());
        ((TextView) helper.getView(R.id.tv_time)).setText(item.getTime());
    }
}
